<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - mbi.info - io/ios_state.hpp</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../index.html">directory</a> - <a href="index.html">io</a> - ios_state.hpp</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>mbi.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2010-01-23</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">10</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">100.0 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">10</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : //  Boost io/ios_state.hpp header file  --------------------------------------//
<span class="lineNum">       2 </span>                : 
<span class="lineNum">       3 </span>                : //  Copyright 2002, 2005 Daryle Walker.  Use, modification, and distribution
<span class="lineNum">       4 </span>                : //  are subject to the Boost Software License, Version 1.0.  (See accompanying
<span class="lineNum">       5 </span>                : //  file LICENSE_1_0.txt or a copy at &lt;http://www.boost.org/LICENSE_1_0.txt&gt;.)
<span class="lineNum">       6 </span>                : 
<span class="lineNum">       7 </span>                : //  See &lt;http://www.boost.org/libs/io/&gt; for the library's home page.
<span class="lineNum">       8 </span>                : 
<span class="lineNum">       9 </span>                : #ifndef BOOST_IO_IOS_STATE_HPP
<span class="lineNum">      10 </span>                : #define BOOST_IO_IOS_STATE_HPP
<span class="lineNum">      11 </span>                : 
<span class="lineNum">      12 </span>                : #include &lt;boost/io_fwd.hpp&gt;  // self include
<span class="lineNum">      13 </span>                : #include &lt;boost/detail/workaround.hpp&gt;
<span class="lineNum">      14 </span>                : 
<span class="lineNum">      15 </span>                : #include &lt;ios&gt;        // for std::ios_base, std::basic_ios, etc.
<span class="lineNum">      16 </span>                : #ifndef BOOST_NO_STD_LOCALE
<span class="lineNum">      17 </span>                : #include &lt;locale&gt;     // for std::locale
<span class="lineNum">      18 </span>                : #endif
<span class="lineNum">      19 </span>                : #include &lt;ostream&gt;    // for std::basic_ostream
<span class="lineNum">      20 </span>                : #include &lt;streambuf&gt;  // for std::basic_streambuf
<span class="lineNum">      21 </span>                : #include &lt;string&gt;     // for std::char_traits
<span class="lineNum">      22 </span>                : 
<span class="lineNum">      23 </span>                : 
<span class="lineNum">      24 </span>                : namespace boost
<span class="lineNum">      25 </span>                : {
<span class="lineNum">      26 </span>                : namespace io
<span class="lineNum">      27 </span>                : {
<span class="lineNum">      28 </span>                : 
<span class="lineNum">      29 </span>                : 
<span class="lineNum">      30 </span>                : //  Basic stream state saver class declarations  -----------------------------//
<span class="lineNum">      31 </span>                : 
<span class="lineNum">      32 </span>                : class ios_flags_saver
<span class="lineNum">      33 </span>                : {
<span class="lineNum">      34 </span>                : public:
<span class="lineNum">      35 </span>                :     typedef ::std::ios_base            state_type;
<span class="lineNum">      36 </span>                :     typedef ::std::ios_base::fmtflags  aspect_type;
<span class="lineNum">      37 </span>                : 
<span class="lineNum">      38 </span>                :     explicit  ios_flags_saver( state_type &amp;s )
<span class="lineNum">      39 </span>                :         : s_save_( s ), a_save_( s.flags() )
<span class="lineNum">      40 </span>                :         {}
<span class="lineNum">      41 </span>                :     ios_flags_saver( state_type &amp;s, aspect_type const &amp;a )
<span class="lineNum">      42 </span>                :         : s_save_( s ), a_save_( s.flags(a) )
<span class="lineNum">      43 </span>                :         {}
<span class="lineNum">      44 </span>                :     ~ios_flags_saver()
<span class="lineNum">      45 </span>                :         { this-&gt;restore(); }
<span class="lineNum">      46 </span>                : 
<span class="lineNum">      47 </span>                :     void  restore()
<span class="lineNum">      48 </span>                :         { s_save_.flags( a_save_ ); }
<span class="lineNum">      49 </span>                : 
<span class="lineNum">      50 </span>                : private:
<span class="lineNum">      51 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">      52 </span>                :     aspect_type const  a_save_;
<span class="lineNum">      53 </span>                : 
<span class="lineNum">      54 </span>                :     ios_flags_saver&amp; operator=(const ios_flags_saver&amp;);
<span class="lineNum">      55 </span>                : };
<span class="lineNum">      56 </span>                : 
<span class="lineNum">      57 </span>                : class ios_precision_saver
<span class="lineNum">      58 </span>                : {
<span class="lineNum">      59 </span>                : public:
<span class="lineNum">      60 </span>                :     typedef ::std::ios_base    state_type;
<span class="lineNum">      61 </span>                :     typedef ::std::streamsize  aspect_type;
<span class="lineNum">      62 </span>                : 
<span class="lineNum">      63 </span>                :     explicit  ios_precision_saver( state_type &amp;s )
<span class="lineNum">      64 </span>                :         : s_save_( s ), a_save_( s.precision() )
<span class="lineNum">      65 </span>                :         {}
<span class="lineNum">      66 </span>                :     ios_precision_saver( state_type &amp;s, aspect_type const &amp;a )
<span class="lineNum">      67 </span>                :         : s_save_( s ), a_save_( s.precision(a) )
<span class="lineNum">      68 </span>                :         {}
<span class="lineNum">      69 </span>                :     ~ios_precision_saver()
<span class="lineNum">      70 </span>                :         { this-&gt;restore(); }
<span class="lineNum">      71 </span>                : 
<span class="lineNum">      72 </span>                :     void  restore()
<span class="lineNum">      73 </span>                :         { s_save_.precision( a_save_ ); }
<span class="lineNum">      74 </span>                : 
<span class="lineNum">      75 </span>                : private:
<span class="lineNum">      76 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">      77 </span>                :     aspect_type const  a_save_;
<span class="lineNum">      78 </span>                : 
<span class="lineNum">      79 </span>                :     ios_precision_saver&amp; operator=(const ios_precision_saver&amp;);
<span class="lineNum">      80 </span>                : };
<span class="lineNum">      81 </span>                : 
<span class="lineNum">      82 </span>                : class ios_width_saver
<span class="lineNum">      83 </span>                : {
<span class="lineNum">      84 </span>                : public:
<span class="lineNum">      85 </span>                :     typedef ::std::ios_base    state_type;
<span class="lineNum">      86 </span>                :     typedef ::std::streamsize  aspect_type;
<span class="lineNum">      87 </span>                : 
<span class="lineNum">      88 </span>                :     explicit  ios_width_saver( state_type &amp;s )
<span class="lineNum">      89 </span>                :         : s_save_( s ), a_save_( s.width() )
<span class="lineNum">      90 </span>                :         {}
<span class="lineNum">      91 </span>                :     ios_width_saver( state_type &amp;s, aspect_type const &amp;a )
<span class="lineNum">      92 </span>                :         : s_save_( s ), a_save_( s.width(a) )
<span class="lineNum">      93 </span>                :         {}
<span class="lineNum">      94 </span>                :     ~ios_width_saver()
<span class="lineNum">      95 </span>                :         { this-&gt;restore(); }
<span class="lineNum">      96 </span>                : 
<span class="lineNum">      97 </span>                :     void  restore()
<span class="lineNum">      98 </span>                :         { s_save_.width( a_save_ ); }
<span class="lineNum">      99 </span>                : 
<span class="lineNum">     100 </span>                : private:
<span class="lineNum">     101 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">     102 </span>                :     aspect_type const  a_save_;
<span class="lineNum">     103 </span>                :     ios_width_saver&amp; operator=(const ios_width_saver&amp;);
<span class="lineNum">     104 </span>                : };
<span class="lineNum">     105 </span>                : 
<span class="lineNum">     106 </span>                : 
<span class="lineNum">     107 </span>                : //  Advanced stream state saver class template declarations  -----------------//
<span class="lineNum">     108 </span>                : 
<span class="lineNum">     109 </span>                : template &lt; typename Ch, class Tr &gt;
<span class="lineNum">     110 </span>                : class basic_ios_iostate_saver
<span class="lineNum">     111 </span>                : {
<span class="lineNum">     112 </span>                : public:
<span class="lineNum">     113 </span>                :     typedef ::std::basic_ios&lt;Ch, Tr&gt;  state_type;
<span class="lineNum">     114 </span>                :     typedef ::std::ios_base::iostate  aspect_type;
<span class="lineNum">     115 </span>                : 
<span class="lineNum">     116 </span>                :     explicit  basic_ios_iostate_saver( state_type &amp;s )
<span class="lineNum">     117 </span>                :         : s_save_( s ), a_save_( s.rdstate() )
<span class="lineNum">     118 </span>                :         {}
<span class="lineNum">     119 </span>                :     basic_ios_iostate_saver( state_type &amp;s, aspect_type const &amp;a )
<span class="lineNum">     120 </span>                :         : s_save_( s ), a_save_( s.rdstate() )
<span class="lineNum">     121 </span>                :         { s.clear(a); }
<span class="lineNum">     122 </span>                :     ~basic_ios_iostate_saver()
<span class="lineNum">     123 </span>                :         { this-&gt;restore(); }
<span class="lineNum">     124 </span>                : 
<span class="lineNum">     125 </span>                :     void  restore()
<span class="lineNum">     126 </span>                :         { s_save_.clear( a_save_ ); }
<span class="lineNum">     127 </span>                : 
<span class="lineNum">     128 </span>                : private:
<span class="lineNum">     129 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">     130 </span>                :     aspect_type const  a_save_;
<span class="lineNum">     131 </span>                : };
<span class="lineNum">     132 </span>                : 
<span class="lineNum">     133 </span>                : template &lt; typename Ch, class Tr &gt;
<span class="lineNum">     134 </span>                : class basic_ios_exception_saver
<span class="lineNum">     135 </span>                : {
<span class="lineNum">     136 </span>                : public:
<span class="lineNum">     137 </span>                :     typedef ::std::basic_ios&lt;Ch, Tr&gt;  state_type;
<span class="lineNum">     138 </span>                :     typedef ::std::ios_base::iostate  aspect_type;
<span class="lineNum">     139 </span>                : 
<span class="lineNum">     140 </span>                :     explicit  basic_ios_exception_saver( state_type &amp;s )
<span class="lineNum">     141 </span>                :         : s_save_( s ), a_save_( s.exceptions() )
<span class="lineNum">     142 </span>                :         {}
<span class="lineNum">     143 </span>                : #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
<span class="lineNum">     144 </span>                :     basic_ios_exception_saver( state_type &amp;s, aspect_type a )
<span class="lineNum">     145 </span>                : #else
<span class="lineNum">     146 </span>                :     basic_ios_exception_saver( state_type &amp;s, aspect_type const &amp;a )
<span class="lineNum">     147 </span>                : #endif
<span class="lineNum">     148 </span>                :         : s_save_( s ), a_save_( s.exceptions() )
<span class="lineNum">     149 </span>                :         { s.exceptions(a); }
<span class="lineNum">     150 </span>                :     ~basic_ios_exception_saver()
<span class="lineNum">     151 </span>                :         { this-&gt;restore(); }
<span class="lineNum">     152 </span>                : 
<span class="lineNum">     153 </span>                :     void  restore()
<span class="lineNum">     154 </span>                :         { s_save_.exceptions( a_save_ ); }
<span class="lineNum">     155 </span>                : 
<span class="lineNum">     156 </span>                : private:
<span class="lineNum">     157 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">     158 </span>                :     aspect_type const  a_save_;
<span class="lineNum">     159 </span>                : };
<span class="lineNum">     160 </span>                : 
<span class="lineNum">     161 </span>                : template &lt; typename Ch, class Tr &gt;
<span class="lineNum">     162 </span>                : class basic_ios_tie_saver
<span class="lineNum">     163 </span>                : {
<span class="lineNum">     164 </span>                : public:
<span class="lineNum">     165 </span>                :     typedef ::std::basic_ios&lt;Ch, Tr&gt;        state_type;
<span class="lineNum">     166 </span>                :     typedef ::std::basic_ostream&lt;Ch, Tr&gt; *  aspect_type;
<span class="lineNum">     167 </span>                : 
<span class="lineNum">     168 </span>                :     explicit  basic_ios_tie_saver( state_type &amp;s )
<span class="lineNum">     169 </span>                :         : s_save_( s ), a_save_( s.tie() )
<span class="lineNum">     170 </span>                :         {}
<span class="lineNum">     171 </span>                :     basic_ios_tie_saver( state_type &amp;s, aspect_type const &amp;a )
<span class="lineNum">     172 </span>                :         : s_save_( s ), a_save_( s.tie(a) )
<span class="lineNum">     173 </span>                :         {}
<span class="lineNum">     174 </span>                :     ~basic_ios_tie_saver()
<span class="lineNum">     175 </span>                :         { this-&gt;restore(); }
<span class="lineNum">     176 </span>                : 
<span class="lineNum">     177 </span>                :     void  restore()
<span class="lineNum">     178 </span>                :         { s_save_.tie( a_save_ ); }
<span class="lineNum">     179 </span>                : 
<span class="lineNum">     180 </span>                : private:
<span class="lineNum">     181 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">     182 </span>                :     aspect_type const  a_save_;
<span class="lineNum">     183 </span>                : };
<span class="lineNum">     184 </span>                : 
<span class="lineNum">     185 </span>                : template &lt; typename Ch, class Tr &gt;
<span class="lineNum">     186 </span>                : class basic_ios_rdbuf_saver
<span class="lineNum">     187 </span>                : {
<span class="lineNum">     188 </span>                : public:
<span class="lineNum">     189 </span>                :     typedef ::std::basic_ios&lt;Ch, Tr&gt;          state_type;
<span class="lineNum">     190 </span>                :     typedef ::std::basic_streambuf&lt;Ch, Tr&gt; *  aspect_type;
<span class="lineNum">     191 </span>                : 
<span class="lineNum">     192 </span>                :     explicit  basic_ios_rdbuf_saver( state_type &amp;s )
<span class="lineNum">     193 </span>                :         : s_save_( s ), a_save_( s.rdbuf() )
<span class="lineNum">     194 </span>                :         {}
<span class="lineNum">     195 </span>                :     basic_ios_rdbuf_saver( state_type &amp;s, aspect_type const &amp;a )
<span class="lineNum">     196 </span>                :         : s_save_( s ), a_save_( s.rdbuf(a) )
<span class="lineNum">     197 </span>                :         {}
<span class="lineNum">     198 </span>                :     ~basic_ios_rdbuf_saver()
<span class="lineNum">     199 </span>                :         { this-&gt;restore(); }
<span class="lineNum">     200 </span>                : 
<span class="lineNum">     201 </span>                :     void  restore()
<span class="lineNum">     202 </span>                :         { s_save_.rdbuf( a_save_ ); }
<span class="lineNum">     203 </span>                : 
<span class="lineNum">     204 </span>                : private:
<span class="lineNum">     205 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">     206 </span>                :     aspect_type const  a_save_;
<span class="lineNum">     207 </span>                : };
<span class="lineNum">     208 </span>                : 
<span class="lineNum">     209 </span>                : template &lt; typename Ch, class Tr &gt;
<span class="lineNum">     210 </span>                : class basic_ios_fill_saver
<span class="lineNum">     211 </span>                : {
<span class="lineNum">     212 </span>                : public:
<span class="lineNum">     213 </span>                :     typedef ::std::basic_ios&lt;Ch, Tr&gt;        state_type;
<span class="lineNum">     214 </span>                :     typedef typename state_type::char_type  aspect_type;
<span class="lineNum">     215 </span>                : 
<span class="lineNum">     216 </span>                :     explicit  basic_ios_fill_saver( state_type &amp;s )
<span class="lineNum">     217 </span>                :         : s_save_( s ), a_save_( s.fill() )
<span class="lineNum">     218 </span>                :         {}
<span class="lineNum">     219 </span>                :     basic_ios_fill_saver( state_type &amp;s, aspect_type const &amp;a )
<span class="lineNum">     220 </span>                :         : s_save_( s ), a_save_( s.fill(a) )
<span class="lineNum">     221 </span>                :         {}
<span class="lineNum">     222 </span>                :     ~basic_ios_fill_saver()
<span class="lineNum">     223 </span>                :         { this-&gt;restore(); }
<span class="lineNum">     224 </span>                : 
<span class="lineNum">     225 </span>                :     void  restore()
<span class="lineNum">     226 </span>                :         { s_save_.fill( a_save_ ); }
<span class="lineNum">     227 </span>                : 
<span class="lineNum">     228 </span>                : private:
<span class="lineNum">     229 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">     230 </span>                :     aspect_type const  a_save_;
<span class="lineNum">     231 </span>                : };
<span class="lineNum">     232 </span>                : 
<span class="lineNum">     233 </span>                : #ifndef BOOST_NO_STD_LOCALE
<span class="lineNum">     234 </span>                : template &lt; typename Ch, class Tr &gt;
<span class="lineNum">     235 </span>                : class basic_ios_locale_saver
<span class="lineNum">     236 </span>                : {
<span class="lineNum">     237 </span>                : public:
<span class="lineNum">     238 </span>                :     typedef ::std::basic_ios&lt;Ch, Tr&gt; state_type;
<span class="lineNum">     239 </span>                :     typedef ::std::locale aspect_type;
<span class="lineNum">     240 </span>                : 
<span class="lineNum">     241 </span>                :     explicit basic_ios_locale_saver( state_type &amp;s )
<span class="lineNum">     242 </span>                :         : s_save_( s ), a_save_( s.getloc() )
<span class="lineNum">     243 </span>                :         {}
<span class="lineNum">     244 </span>                :     basic_ios_locale_saver( state_type &amp;s, aspect_type const &amp;a )
<span class="lineNum">     245 </span>                :         : s_save_( s ), a_save_( s.imbue(a) )
<span class="lineNum">     246 </span>                :         {}
<span class="lineNum">     247 </span>                :     ~basic_ios_locale_saver()
<span class="lineNum">     248 </span>                :         { this-&gt;restore(); }
<span class="lineNum">     249 </span>                : 
<span class="lineNum">     250 </span>                :     void  restore()
<span class="lineNum">     251 </span>                :         { s_save_.imbue( a_save_ ); }
<span class="lineNum">     252 </span>                : 
<span class="lineNum">     253 </span>                : private:
<span class="lineNum">     254 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">     255 </span>                :     aspect_type const  a_save_;
<span class="lineNum">     256 </span>                : };
<span class="lineNum">     257 </span>                : #endif
<span class="lineNum">     258 </span>                : 
<span class="lineNum">     259 </span>                : 
<span class="lineNum">     260 </span>                : //  User-defined stream state saver class declarations  ----------------------//
<span class="lineNum">     261 </span>                : 
<span class="lineNum">     262 </span>                : class ios_iword_saver
<span class="lineNum">     263 </span>                : {
<span class="lineNum">     264 </span>                : public:
<span class="lineNum">     265 </span>                :     typedef ::std::ios_base  state_type;
<span class="lineNum">     266 </span>                :     typedef int              index_type;
<span class="lineNum">     267 </span>                :     typedef long             aspect_type;
<span class="lineNum">     268 </span>                : 
<span class="lineNum">     269 </span>                :     explicit ios_iword_saver( state_type &amp;s, index_type i )
<span class="lineNum">     270 </span>                :         : s_save_( s ), a_save_( s.iword(i) ), i_save_( i )
<span class="lineNum">     271 </span>                :         {}
<span class="lineNum">     272 </span>                :     ios_iword_saver( state_type &amp;s, index_type i, aspect_type const &amp;a )
<span class="lineNum">     273 </span>                :         : s_save_( s ), a_save_( s.iword(i) ), i_save_( i )
<span class="lineNum">     274 </span>                :         { s.iword(i) = a; }
<span class="lineNum">     275 </span>                :     ~ios_iword_saver()
<span class="lineNum">     276 </span>                :         { this-&gt;restore(); }
<span class="lineNum">     277 </span>                : 
<span class="lineNum">     278 </span>                :     void  restore()
<span class="lineNum">     279 </span>                :         { s_save_.iword( i_save_ ) = a_save_; }
<span class="lineNum">     280 </span>                : 
<span class="lineNum">     281 </span>                : private:
<span class="lineNum">     282 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">     283 </span>                :     aspect_type const  a_save_;
<span class="lineNum">     284 </span>                :     index_type const   i_save_;
<span class="lineNum">     285 </span>                : 
<span class="lineNum">     286 </span>                :     ios_iword_saver&amp; operator=(const ios_iword_saver&amp;);
<span class="lineNum">     287 </span>                : };
<span class="lineNum">     288 </span>                : 
<span class="lineNum">     289 </span>                : class ios_pword_saver
<span class="lineNum">     290 </span>                : {
<span class="lineNum">     291 </span>                : public:
<span class="lineNum">     292 </span>                :     typedef ::std::ios_base  state_type;
<span class="lineNum">     293 </span>                :     typedef int              index_type;
<span class="lineNum">     294 </span>                :     typedef void *           aspect_type;
<span class="lineNum">     295 </span>                : 
<span class="lineNum">     296 </span>                :     explicit  ios_pword_saver( state_type &amp;s, index_type i )
<span class="lineNum">     297 </span>                :         : s_save_( s ), a_save_( s.pword(i) ), i_save_( i )
<span class="lineNum">     298 </span>                :         {}
<span class="lineNum">     299 </span>                :     ios_pword_saver( state_type &amp;s, index_type i, aspect_type const &amp;a )
<span class="lineNum">     300 </span>                :         : s_save_( s ), a_save_( s.pword(i) ), i_save_( i )
<span class="lineNum">     301 </span>                :         { s.pword(i) = a; }
<span class="lineNum">     302 </span>                :     ~ios_pword_saver()
<span class="lineNum">     303 </span>                :         { this-&gt;restore(); }
<span class="lineNum">     304 </span>                : 
<span class="lineNum">     305 </span>                :     void  restore()
<span class="lineNum">     306 </span>                :         { s_save_.pword( i_save_ ) = a_save_; }
<span class="lineNum">     307 </span>                : 
<span class="lineNum">     308 </span>                : private:
<span class="lineNum">     309 </span>                :     state_type &amp;       s_save_;
<span class="lineNum">     310 </span>                :     aspect_type const  a_save_;
<span class="lineNum">     311 </span>                :     index_type const   i_save_;
<span class="lineNum">     312 </span>                : 
<span class="lineNum">     313 </span>                :     ios_pword_saver operator=(const ios_pword_saver&amp;);
<span class="lineNum">     314 </span>                : };
<span class="lineNum">     315 </span>                : 
<span class="lineNum">     316 </span>                : 
<span class="lineNum">     317 </span>                : //  Combined stream state saver class (template) declarations  ---------------//
<span class="lineNum">     318 </span>                : 
<span class="lineNum">     319 </span>                : class ios_base_all_saver
<span class="lineNum">     320 </span>                : {
<span class="lineNum">     321 </span>                : public:
<span class="lineNum">     322 </span>                :     typedef ::std::ios_base  state_type;
<span class="lineNum">     323 </span>                : 
<span class="lineNum">     324 </span><span class="lineCov">              4 :     explicit  ios_base_all_saver( state_type &amp;s )</span>
<span class="lineNum">     325 </span>                :         : s_save_( s ), a1_save_( s.flags() ), a2_save_( s.precision() )
<span class="lineNum">     326 </span><span class="lineCov">              4 :         , a3_save_( s.width() )</span>
<span class="lineNum">     327 </span><span class="lineCov">              4 :         {}</span>
<span class="lineNum">     328 </span>                : 
<span class="lineNum">     329 </span><span class="lineCov">              4 :     ~ios_base_all_saver()</span>
<span class="lineNum">     330 </span><span class="lineCov">              4 :         { this-&gt;restore(); }</span>
<span class="lineNum">     331 </span>                : 
<span class="lineNum">     332 </span><span class="lineCov">             19 :     void  restore()</span>
<span class="lineNum">     333 </span>                :     {
<span class="lineNum">     334 </span><span class="lineCov">             19 :         s_save_.width( a3_save_ );</span>
<span class="lineNum">     335 </span><span class="lineCov">             19 :         s_save_.precision( a2_save_ );</span>
<span class="lineNum">     336 </span><span class="lineCov">             19 :         s_save_.flags( a1_save_ );</span>
<span class="lineNum">     337 </span><span class="lineCov">             19 :     }</span>
<span class="lineNum">     338 </span>                : 
<span class="lineNum">     339 </span>                : private:
<span class="lineNum">     340 </span>                :     state_type &amp;                s_save_;
<span class="lineNum">     341 </span>                :     state_type::fmtflags const  a1_save_;
<span class="lineNum">     342 </span>                :     ::std::streamsize const     a2_save_;
<span class="lineNum">     343 </span>                :     ::std::streamsize const     a3_save_;
<span class="lineNum">     344 </span>                : 
<span class="lineNum">     345 </span>                :     ios_base_all_saver&amp; operator=(const ios_base_all_saver&amp;);
<span class="lineNum">     346 </span>                : };
<span class="lineNum">     347 </span>                : 
<span class="lineNum">     348 </span>                : template &lt; typename Ch, class Tr &gt;
<span class="lineNum">     349 </span>                : class basic_ios_all_saver
<span class="lineNum">     350 </span>                : {
<span class="lineNum">     351 </span>                : public:
<span class="lineNum">     352 </span>                :     typedef ::std::basic_ios&lt;Ch, Tr&gt;  state_type;
<span class="lineNum">     353 </span>                : 
<span class="lineNum">     354 </span>                :     explicit  basic_ios_all_saver( state_type &amp;s )
<span class="lineNum">     355 </span>                :         : s_save_( s ), a1_save_( s.flags() ), a2_save_( s.precision() )
<span class="lineNum">     356 </span>                :         , a3_save_( s.width() ), a4_save_( s.rdstate() )
<span class="lineNum">     357 </span>                :         , a5_save_( s.exceptions() ), a6_save_( s.tie() )
<span class="lineNum">     358 </span>                :         , a7_save_( s.rdbuf() ), a8_save_( s.fill() )
<span class="lineNum">     359 </span>                :         #ifndef BOOST_NO_STD_LOCALE
<span class="lineNum">     360 </span>                :         , a9_save_( s.getloc() )
<span class="lineNum">     361 </span>                :         #endif
<span class="lineNum">     362 </span>                :         {}
<span class="lineNum">     363 </span>                : 
<span class="lineNum">     364 </span>                :     ~basic_ios_all_saver()
<span class="lineNum">     365 </span>                :         { this-&gt;restore(); }
<span class="lineNum">     366 </span>                : 
<span class="lineNum">     367 </span>                :     void  restore()
<span class="lineNum">     368 </span>                :     {
<span class="lineNum">     369 </span>                :         #ifndef BOOST_NO_STD_LOCALE
<span class="lineNum">     370 </span>                :         s_save_.imbue( a9_save_ );
<span class="lineNum">     371 </span>                :         #endif
<span class="lineNum">     372 </span>                :         s_save_.fill( a8_save_ );
<span class="lineNum">     373 </span>                :         s_save_.rdbuf( a7_save_ );
<span class="lineNum">     374 </span>                :         s_save_.tie( a6_save_ );
<span class="lineNum">     375 </span>                :         s_save_.exceptions( a5_save_ );
<span class="lineNum">     376 </span>                :         s_save_.clear( a4_save_ );
<span class="lineNum">     377 </span>                :         s_save_.width( a3_save_ );
<span class="lineNum">     378 </span>                :         s_save_.precision( a2_save_ );
<span class="lineNum">     379 </span>                :         s_save_.flags( a1_save_ );
<span class="lineNum">     380 </span>                :     }
<span class="lineNum">     381 </span>                : 
<span class="lineNum">     382 </span>                : private:
<span class="lineNum">     383 </span>                :     state_type &amp;                            s_save_;
<span class="lineNum">     384 </span>                :     typename state_type::fmtflags const     a1_save_;
<span class="lineNum">     385 </span>                :     ::std::streamsize const                 a2_save_;
<span class="lineNum">     386 </span>                :     ::std::streamsize const                 a3_save_;
<span class="lineNum">     387 </span>                :     typename state_type::iostate const      a4_save_;
<span class="lineNum">     388 </span>                :     typename state_type::iostate const      a5_save_;
<span class="lineNum">     389 </span>                :     ::std::basic_ostream&lt;Ch, Tr&gt; * const    a6_save_;
<span class="lineNum">     390 </span>                :     ::std::basic_streambuf&lt;Ch, Tr&gt; * const  a7_save_;
<span class="lineNum">     391 </span>                :     typename state_type::char_type const    a8_save_;
<span class="lineNum">     392 </span>                :     #ifndef BOOST_NO_STD_LOCALE
<span class="lineNum">     393 </span>                :     ::std::locale const                     a9_save_;
<span class="lineNum">     394 </span>                :     #endif
<span class="lineNum">     395 </span>                : };
<span class="lineNum">     396 </span>                : 
<span class="lineNum">     397 </span>                : class ios_all_word_saver
<span class="lineNum">     398 </span>                : {
<span class="lineNum">     399 </span>                : public:
<span class="lineNum">     400 </span>                :     typedef ::std::ios_base  state_type;
<span class="lineNum">     401 </span>                :     typedef int              index_type;
<span class="lineNum">     402 </span>                : 
<span class="lineNum">     403 </span>                :     ios_all_word_saver( state_type &amp;s, index_type i )
<span class="lineNum">     404 </span>                :         : s_save_( s ), i_save_( i ), a1_save_( s.iword(i) )
<span class="lineNum">     405 </span>                :         , a2_save_( s.pword(i) )
<span class="lineNum">     406 </span>                :         {}
<span class="lineNum">     407 </span>                : 
<span class="lineNum">     408 </span>                :     ~ios_all_word_saver()
<span class="lineNum">     409 </span>                :         { this-&gt;restore(); }
<span class="lineNum">     410 </span>                : 
<span class="lineNum">     411 </span>                :     void  restore()
<span class="lineNum">     412 </span>                :     {
<span class="lineNum">     413 </span>                :         s_save_.pword( i_save_ ) = a2_save_;
<span class="lineNum">     414 </span>                :         s_save_.iword( i_save_ ) = a1_save_;
<span class="lineNum">     415 </span>                :     }
<span class="lineNum">     416 </span>                : 
<span class="lineNum">     417 </span>                : private:
<span class="lineNum">     418 </span>                :     state_type &amp;      s_save_;
<span class="lineNum">     419 </span>                :     index_type const  i_save_;
<span class="lineNum">     420 </span>                :     long const        a1_save_;
<span class="lineNum">     421 </span>                :     void * const      a2_save_;
<span class="lineNum">     422 </span>                : 
<span class="lineNum">     423 </span>                :     ios_all_word_saver&amp; operator=(const ios_all_word_saver&amp;);
<span class="lineNum">     424 </span>                : };
<span class="lineNum">     425 </span>                : 
<span class="lineNum">     426 </span>                : 
<span class="lineNum">     427 </span>                : }  // namespace io
<span class="lineNum">     428 </span>                : }  // namespace boost
<span class="lineNum">     429 </span>                : 
<span class="lineNum">     430 </span>                : 
<span class="lineNum">     431 </span>                : #endif  // BOOST_IO_IOS_STATE_HPP
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
